# Base Image
FROM php:5.6-fpm

# System commod
ADD ./sources.list /etc/apt/sources.list
ADD ./instantclient.tar.gz /opt/instantclient.tar.gz

# oracle扩展 + oci8扩展
RUN apt-get update && apt-get install -y libaio-dev
RUN mv /opt/instantclient.tar.gz/instantclient /opt/instantclient \
	&& rm -rf /opt/instantclient.tar.gz \
	&& echo "/opt/instantclient" >> /etc/ld.so.conf.d/oracle-instantclient.conf && ldconfig \
	&& docker-php-ext-configure oci8 --with-oci8="instantclient,/opt/instantclient" \
	&& docker-php-ext-install oci8 \
	&& docker-php-ext-configure pdo_oci --with-pdo-oci="instantclient,/opt/instantclient,12.1" \
	&& docker-php-ext-install pdo_oci